import 'package:flutter/services.dart';

///主题背景颜色
const Color Color_theme = Color(0xFFC5283B);
const Color Color_select_btn = Color(0xFF4982EB);

///子视图背景颜色
const Color Color_bg_view = Color(0xFF2F2F32);
const Color Color_line_view = Color(0xFF4C4C4E);

class GlobalConfig {
  static double scaleH = 0.0;
}

class assets {
  static const String _basePath = 'assets/images/';

  static String getImagePath(String imageName) {
    return '$_basePath$imageName.png';
  }

  // 定义具体的图片资源
  static const String add = '${_basePath}add.png';
  static const String sum = '${_basePath}sum.png';
  static const String bg = '${_basePath}bg.png';
  static const String add_plus = '${_basePath}add_plus.png';
  static const String album = '${_basePath}album.png';
  static const String back = '${_basePath}back.png';
  static const String color_point = '${_basePath}color_point.png';
  static const String color = '${_basePath}color.png';
  static const String color1_select = '${_basePath}color1_select.png';
  static const String color1 = '${_basePath}color1.png';
  static const String color2_select = '${_basePath}color2_select.png';
  static const String color2 = '${_basePath}color2.png';
  static const String color3_select = '${_basePath}color3_select.png';
  static const String color3 = '${_basePath}color3.png';
  static const String color4_select = '${_basePath}color4_select.png';
  static const String color4 = '${_basePath}color4.png';
  static const String color5_select = '${_basePath}color5_select.png';
  static const String color5 = '${_basePath}color5.png';

  static const String color6_select = '${_basePath}color6_select.png';
  static const String color6 = '${_basePath}color6.png';
  static const String color7_select = '${_basePath}color7_select.png';
  static const String color7 = '${_basePath}color7.png';
  static const String color8_select = '${_basePath}color8_select.png';
  static const String color8 = '${_basePath}color8.png';

  static const String color9_select = '${_basePath}color9_select.png';
  static const String color9 = '${_basePath}color9.png';
  static const String color10_select = '${_basePath}color10_select.png';
  static const String color10 = '${_basePath}color10.png';

  static const String color11_select = '${_basePath}color11_select.png';
  static const String color11 = '${_basePath}color11.png';

  static const String color12_select = '${_basePath}color12_select.png';
  static const String color12 = '${_basePath}color12.png';

  static const String color13_select = '${_basePath}color13_select.png';
  static const String color13 = '${_basePath}color13.png';
  static const String color14_select = '${_basePath}color14_select.png';
  static const String color14 = '${_basePath}color14.png';
  static const String connect_select = '${_basePath}connect_select.png';
  static const String connect = '${_basePath}connect.png';
  static const String disconnect_select = '${_basePath}disconnect_select.png';
  static const String disconnect = '${_basePath}disconnect.png';
  static const String g_blue = '${_basePath}g_blue.png';
  static const String g_cyan = '${_basePath}g_cyan.png';
  static const String g_gblue = '${_basePath}g_gblue.png';
  static const String g_green = '${_basePath}g_green.png';
  static const String g_purpple = '${_basePath}g_purpple.png';
  static const String g_red = '${_basePath}g_red.png';
  static const String g_redblue = '${_basePath}g_redblue.png';
  static const String g_redgreen = '${_basePath}g_redgreen.png';
  static const String g_sevencolor = '${_basePath}g_sevencolor.png';
  static const String g_white = '${_basePath}g_white.png';
  static const String g_yellow = '${_basePath}g_yellow.png';
  static const String light_off = '${_basePath}light_off.png';
  static const String light_on = '${_basePath}light_on.png';
  static const String LOGO2 = '${_basePath}LOGO2.png';
  static const String mic_off = '${_basePath}mic_off.png';
  static const String mic_on = '${_basePath}mic_on.png';
  static const String RGB_select = '${_basePath}RGB_select.png';
  static const String RGB = '${_basePath}RGB.png';
  static const String s_blue = '${_basePath}s_blue.png';
  static const String s_cyan = '${_basePath}s_cyan.png';
  static const String s_green = '${_basePath}s_green.png';
  static const String s_purpple = '${_basePath}s_purpple.png';
  static const String s_red = '${_basePath}s_red.png';
  static const String s_sevencolor = '${_basePath}s_sevencolor.png';
  static const String s_white = '${_basePath}s_white.png';
  static const String s_yellow = '${_basePath}s_yellow.png';
  static const String setup_off = '${_basePath}setup_off.png';
  static const String setup_on = '${_basePath}setup_on.png';
  static const String turn_off = '${_basePath}turn_off.png';
  static const String turn_on = '${_basePath}turn_on.png';
  static const String xuan_kedu = '${_basePath}xuan_kedu.png';
  static const String xuan = '${_basePath}xuan.png';
  static const String move = '${_basePath}move.png';
  static const String delete = '${_basePath}delete.png';

  ///读取本地文件
  static Future<Uint8List?> readBinFile(String fileName) async {
    try {
      // 读取 bin 文件
      ByteData data = await rootBundle.load('assets/$fileName');

      // 将 ByteData 转换为 Uint8List 并返回
      return data.buffer.asUint8List();
    } catch (e) {
      print('Error reading bin file: $e');
      return null;
    }
  }
}
